//
// Created by 26090 on 24-12-14.
//

#ifndef BSP_TIM_H
#define BSP_TIM_H

#include "tim.h"

typedef struct
{
    TIM_HandleTypeDef *tim_handle;
    uint32_t channel;
    float frequency;                //尚未使用
    float duty;
}PWMInstance;

typedef struct
{
    TIM_HandleTypeDef *tim_handle;
    uint32_t channel;
} PWM_Init_Config_s;

PWMInstance *PWMRegister(PWM_Init_Config_s *init_config);

void PWM_SetDuty(PWMInstance *instance, const float duty);

#endif //BSP_TIM_H
